<?php
/**
 * 	Bushido
 *
 * @category   Bushido
 * @package    Bushido_FusionCharts
 * @subpackage Theme
 * @copyright  Copyright (c) 2008-2009 Nathan Keyes
 * @author Nathan Keyes
 * @version    $Id: SeverityStackedBar.php 7 2009-11-14 22:42:08Z nkeyes $
 */


/**
 * 
 * @author Nathan Keyes
 *
 */
class Bushido_FusionCharts_Theme_SeverityStackedBar extends Bushido_FusionCharts_Theme_MultiSeries
{

	/**
	 * 
	 * @return void
	 */
	public function __construct()
	{
		parent::__construct();
		$this->name = 'SeverityStackedBar';
		$this->chartType = Bushido_FusionCharts::STACKED_BAR;
	}
	
	
	/**
	 * (non-PHPdoc)
	 * @see library/Bushido/FusionCharts/Theme/Bushido_FusionCharts_Theme_MultiSeries#getDataSetNode()
	 */
	public function getDataSetNode($name)
	{
		return "<dataset SeriesName='$name' ratio='100,100'/>";	
	}
	
	
	/**
	 * (non-PHPdoc)
	 * @see library/Bushido/FusionCharts/Theme/Bushido_FusionCharts_Theme_MultiSeries#getDataNode()
	 */
	public function getDataNode($label, $value)
	{
		
		if($value < 0)
		{
			$value = 100;
		}
		$setNode =  "<set label='" . htmlentities($label) . "' value='$value'/>";
		return $setNode;
	}
}
